import React from 'react'
import { Input, Form } from "antd"
import { FormInstance } from 'antd/lib/form'

export default function Myinput(props: { myref: React.RefObject<Input>; onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; form: FormInstance }) {
  const { myref, onChange, form } = props

  return <Form form={form}>
    <Form.Item
      label="变量名称"
      name="变量名称"
      rules={[{ pattern: /^[a-zA-Z]\w{1,80}$/, message: '变量名称不合法' }]}
    >
      <Input ref={myref} type="text" placeholder="请输入变量名称" onChange={onChange} ></Input>
    </Form.Item>
  </Form>
}